import cv2
from PIL import Image
import numpy as np
import torchvision
import torch

raw_img:np.ndarray=cv2.imread('../NCT-CRC-HE-100K/DEB/DEB-AAAPHWDG.tif',cv2.IMREAD_UNCHANGED)
print(type(raw_img))
print(raw_img.shape)

pure_totensor=torchvision.transforms.ToTensor()
arr1:torch.Tensor=pure_totensor(raw_img)

means=[0.4,0.5,0.3]
stds=[0.8,0.7,0.6,]
totensor_normalize=torchvision.transforms.transforms.Compose(
    [
        torchvision.transforms.ToTensor(),
        torchvision.transforms.Normalize(means,stds),
    ]
)
arr2:torch.Tensor=totensor_normalize(raw_img)

print(arr1[0][13][17],arr2[0][13][17])
print(arr1[1][107][17],arr2[1][107][17])
print(arr1[2][43][54],arr2[2][43][54])